package com.shuwang.jh_shop.ui.fragment
import android.support.v4.app.Fragment
import android.view.View
import com.shuwang.jh_shop.R
import com.shuwang.jh_shop.ui.adapter.TabFragmentPagerAdapter
import com.shuwang.jh_shop.ui.base.BaseFragment
import com.shuwang.jh_shop.ui.fragment.QueryChildFragment
import kotlinx.android.synthetic.main.center_toolbar.*
import kotlinx.android.synthetic.main.fragment_query.*

/**
 * 作者  格锅
 * 时间  2017/4/5 18:06
 * 文件  Tf_app
 * 描述  查找
 */
class QueryFragment: BaseFragment() {
    override fun setContentView() {
        setContentView(R.layout.fragment_query)
        initView()
    }
    override fun getView(): View? {
        return getContentView()
    }
    private fun initView() {
        center_title.text="查找"
        var names = arrayListOf("设备查询", "客户查询")
        val mFragentList = arrayListOf<Fragment>(QueryChildFragment.newInstance(0), QueryChildFragment.newInstance(2))
        var adapter = TabFragmentPagerAdapter(activity.supportFragmentManager,names,mFragentList)
        viewpager?.adapter = adapter
        viewpager?.offscreenPageLimit=1
        query_tab?.setupWithViewPager(viewpager)

    }
}